<?php $this->load->view('_header');?>
<script type="text/javascript">
<!--

//-->
$(document).ready(function(){
	setCurrentMenu(1);
	var filterJson = <?php echo $filterJson;?>;
	$("div[id^='restaurant_']").each(function(){
		$(this).children(":last").children(".hiddenButtonWrapper").hide();
		$(this).click(function(){
			
		});
		$(this).mouseover(function(){
			$(this).children(":last").children(".hiddenButtonWrapper").show();		
		});
		$(this).mouseout(function(){
			$(this).children(":last").children(".hiddenButtonWrapper").hide();		
		});
		var id = parseInt($(this).attr("id").split("_")[1]);
		if($.inArray(id, filterJson.compensate) >= 0){
			$(this).addClass("compensate");
		}
		if($.inArray(id, filterJson.promotion) >= 0){
			$(this).addClass("promotion");
		}
		if($.inArray(id, filterJson.open) >= 0){
			$(this).addClass("open");
		}else{
			$(this).addClass("closed");
		}
	});
	var options	= {
			enabled : false,
			image  : "/images/star3.gif",
			min    : 1,
			max	   : 5,
			step   : 1,
			width	: 20,
			height	: 17,
			tips   : ['很差','较差','一般','推荐','力荐']
	}
	$("span.rater").each(function(){
  		options["value"] = $(this).text();
  		$(this).rater(options);
  	});
  	$("span.checkbox").click(function(){
  	    var temp = filterJson.all;
		$(this).parent().toggleClass("checked");
		$("span[id^='filter'].checked").each(function(){
  	  	    var name = $(this).attr("id").split("_")[1];
			temp = Array.intersect(temp,filterJson[name]);
		});
		$("div[id^='restaurant_']").hide();
		for(var i in temp){
			$("div[id='restaurant_"+temp[i]+"']").show();
		}
  	});
	$("div.sort_key").each(function(){
		$(this).hide();
	});
	$("div.search_key").each(function(){
		$(this).hide();
	});
  	$("#sort_mode_select").change(function(){
		$("div#restaurantList>div").tsort("div.sort_key span.sort_key_"+$(this).val(),{order:$(this).find("option:selected").attr("title")});
  	});
  	$(".search_input").keyup(function(){
  	  	var input = $(this).val();
  		$("div[id^='restaurant_']").each(function(){
			if($(this).find("span.search_key_name").text().indexOf(input)!=-1){
				$(this).show();
			}else{
				$(this).hide();
			}
  	  	});
  	});
});
</script>
<div class="row">
	<div class="col">
		<div id="crumb">
			<a class="link" href=<?php echo base_url().'home/clear'?>>更换地点</a> &gt; <a class="link"
				href="<?php echo base_url().'home/entry/at/'.$entry["id"]?>"><?php  echo $entry["name"]; ?>
			</a>
		</div>
	</div>
</div>
<div class="row">
	<div class="col">
		<!--  
		<div id="nav_panel" class="gp_border_thick">
			<div id="nav_panel_summary">
				<span><?php echo $entry["name"]; ?>附近共有<?php echo count($rsts); ?>家餐厅</span>
			</div>
			-->
			<!-- 
    		<div id="filter_search_box">
				<div id="filter_box">
					<span id="filter_open" class="filter_checkbox">
	                    <span class="checkbox"></span>营业中
	                </span>
					<span id="filter_compensate" class="filter_checkbox">
						<span class="checkbox"></span>超时赔付
					</span>
					<span id="filter_promotion" class="filter_checkbox">
						<span class="checkbox"></span>优惠
					</span>
					<span id="filter_zhongshi" class="filter_checkbox">
	                    <span class="checkbox"></span>中式           
	                </span>
	                <span id="filter_xishi" class="filter_checkbox">
	                    <span class="checkbox"></span>西式           
	                </span>
	                <span id="filter_rishi" class="filter_checkbox">
	                    <span class="checkbox"></span>日式       
	                </span>
	                <span id="filter_hanshi" class="filter_checkbox">
	                    <span class="checkbox"></span>韩式           
	                </span>
	                <span id="filter_shaokao" class="filter_checkbox">
	                    <span class="checkbox"></span>烧烤          
	                </span>
				</div>
				<div id="search_box">
					<div class="outter">
						<input type="text" class="search_input"/>
					</div>
					<button type="submit" class="search_btn"></button>
				</div>
			</div>
			-->
			<div class="clear">
			</div>
            <!--
			<div id="select_view">
				<a href="#" class="listView">列表视图</a>
				<a href="#" class="mapView">地图视图</a>
			</div>
			<div id="sort_box">
					<select id="sort_mode_select" name="sort_mode">
						<option value="default" title="asc">默认排序</option>
						<option value="rating" title="desc">按评价</option>
						<option value="distance" title="asc">按距离</option>
						<option value="minimum" title="asc">按起送价格</option>
					</select>
			</div>
		</div>
           -->
		<div class="clear"></div>
		<div id="restaurantList" class="restaurant_list mb10 mt10 gp_border_thin">
		<?php foreach($rsts as $index => $row) { ?>
			<div class="restaurant_out_box">
				<div id="restaurant_<?php echo $row['id'];?>" class="restaurant_box" onclick="javascript:location.href='<?php echo base_url().'restaurant/homepage/'.$row["id"]?>'">
					<div class="sort_key">
						<span class="sort_key_default"><?php echo $row["id"];?></span>
						<span class="sort_key_rating"><?php echo $row["rating"];?></span>
						<span class="sort_key_distance"><?php echo $row["distance"];?></span>
						<span class="sort_key_minimum"><?php echo $row["minimum"];?></span>
					</div>
					<div class="search_key">
						<span class="search_key_name"><?php  echo $row["name"];?></span>
					</div>
					<div class="restLogo">
						<a  href="<?php echo base_url().'restaurant/homepage/'.$row["id"]?>">
							<img alt="" src="<?php echo $row["picture"];?>">
						</a>
					</div>
					<div class="restInfo">
						<div class="restName">
							<a href="<?php echo base_url().'restaurant/homepage/'.$row["id"]?>"> 
						    	<span class="rest_name" ><?php  echo $row["name"];?></span>
							</a>
						</div>
						<div class="restOtherInfo">
							<ul>
								<li><span class="rater"><?php echo $row["rating"];?> </span></li>
								<li  class="rest_price">起送价格: <?php  echo $row["minimum"]; ?></li>
								<li  class="rest_price"><?php  /*echo $row["serviceTime"]; */?></li>
							</ul>
						</div>
					</div>
					<div class="clear"> </div>
					
				</div>
            </div>
            <?php /**if($index%3==2) echo "<hr />";**/?>

		<?php }?>
		</div>
	</div>
</div>
<div class="clear"></div>

<?php $this->load->view('_footer')?>
